<template>
  <aside class="btn-box">
    <el-row :gutter="15">
      <el-col :span="2">
        <el-button type="primary" size="mini" icon="el-icon-search" @click="searchFun">检索</el-button>
        <search-dialog ref="searchDialog" @search="search" />
      </el-col>
      <el-col :span="2">
        <el-button v-permission="['admin']" type="primary" size="mini" icon="el-icon-download" @click="downloadFun">导出</el-button>
      </el-col>
    </el-row>
  </aside>
</template>

<script>
import searchDialog from './search-dialog'
import permission from '@/directive/permission'
export default {
  directives: {
    permission
  },
  components: {
    searchDialog
  },
  methods: {
    searchFun() {
      this.$refs['searchDialog'].dialogShow = true
    },
    search(val) {
      this.$emit('search', val)
    },
    downloadFun() {
      this.$emit('download')
    }
  }
}
</script>

<style lang="sass" scoped>

</style>
